home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sprite 1984 - 1993
/
Sprite 1984 - 1993.iso
/
src
/
lib
/
include
/
dev
/
RCS
/
vmelink.h,v
< prev
next >
Wrap
Text File
|
1992-08-25
|
10KB
|
336 lines
head 1.4;
branch ;
access ;
symbols ;
locks elm:1.4; strict;
comment @ * @;
1.4
date 92.07.09.18.28.31; author elm; state Exp;
branches ;
next 1.3;
1.3
date 92.06.29.12.20.22; author elm; state Exp;
branches ;
next 1.2;
1.2
date 91.10.16.14.30.48; author elm; state Exp;
branches ;
next 1.1;
1.1
date 90.12.05.12.25.40; author elm; state Exp;
branches ;
next ;
desc
@Include file for the VME link board.
@
1.4
log
@Added ioctls for safe copying (using Mach_Probe to transfer data instead
of actual pointer manipulation). Slower but less likely to crash Sprite.
@
text
@/*
* vmelink.h --
*
* Declarations of interface to the Bit-3 VME link driver routines.
*
* Copyright 1990 Regents of the University of California
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
* notice appear in all copies. The University of California
* makes no representations about the suitability of this
* software for any purpose. It is provided "as is" without
* express or implied warranty.
*
* $Header: /sprite/src/lib/include/dev/RCS/vmelink.h,v 1.3 92/06/29 12:20:22 elm Exp Locker: elm $ SPRITE (Berkeley)
*/
#ifndef _VMELINK
#define _VMELINK
/*
* Sun4 address space the link occupies (2=d16, 3=d32)
*/
#define DEV_VMELINK_ADDR_SPACE 2
/*
* Size of the VME link useful address space in pages.
*/
#define DEV_VMELINK_VME_START_ADDR 0xff400000
#define DEV_VMELINK_VME_ADDR_SIZE 0x00020000
#define DEV_VMELINK_NUM_PAGES (VMELINK_VME_ADDR_SIZE / PAGSIZ)
/*
* Flags used to set the local command register.
*/
#define DEV_VMELINK_CLEAR_LOCAL_ERRS 0x80
#define DEV_VMELINK_CLEAR_LOCAL_PF_INT 0x40
#define DEV_VMELINK_SET_REMOTE_PT_INT 0x20
#define DEV_VMELINK_DISABLE_LOCAL_INT 0x04
/*
* Flags in the status registers.
*/
#define DEV_VMELINK_PARITY_ERROR 0x80
#define DEV_VMELINK_REMOTE_BUSERR 0x40
#define DEV_VMELINK_LOCAL_PR_INT 0x20
#define DEV_VMELINK_LOCAL_PT_INT 0x02
#define DEV_VMELINK_REMOTE_DOWN 0x01
/*
* Flags used to set remote command register 1.
*/
#define DEV_VMELINK_REMOTE_RESET 0x80
#define DEV_VMELINK_CLEAR_REMOTE_PT_INT 0x40
#define DEV_VMELINK_SET_REMOTE_PR_INT 0x20
#define DEV_VMELINK_LOCK_VME 0x10
#define DEV_VMELINK_USE_PAGE_REG 0x08
/*
* Flags used to set remote command register 2.
*/
#define DEV_VMELINK_REMOTE_USE_ADDRMOD 0x40
#define DEV_VMELINK_REMOTE_BLKMODE_DMA 0x20
#define DEV_VMELINK_DISABLE_REMOTE_INT 0x10
/*
* Window size flags (for IOC_VMELINK_SET_WINDOW_SIZE IO control).
*/
#define DEV_VMELINK_WINDOW_SIZE_64K 0x00
#define DEV_VMELINK_WINDOW_SIZE_128K 0x01
#define DEV_VMELINK_WINDOW_SIZE_256K 0x03
#define DEV_VMELINK_WINDOW_SIZE_512K 0x07
#define DEV_VMELINK_WINDOW_SIZE_1M 0x0f
#define DEV_VMELINK_MIN_DMA_SIZE 256
#define DEV_VMELINK_DMA_START 0x80
#define DEV_VMELINK_DMA_LONGWORD 0x10
#define DEV_VMELINK_DMA_LOCAL_PAUSE 0x08
#define DEV_VMELINK_DMA_ENABLE_INTR 0x04
#define DEV_VMELINK_DMA_DONE 0x02
#define DEV_VMELINK_DMA_BLOCK_MODE 0x01
#define DEV_VMELINK_DMA_LOCAL_TO_REMOTE 0x20
#define DEV_VMELINK_DMA_REMOTE_TO_LOCAL 0x00
/*
* This is the control register structure for the VME link
* boards. All of the rsvX fields are listed as reserved in
* the manual.
*
*/
typedef struct DevVMElinkCtrlRegs {
volatile unsigned char rsv0;
volatile unsigned char LocalCmd; /* local command register */
volatile unsigned char rsv1;
volatile unsigned char LocalStatus; /* local status reg */
volatile unsigned char LocalAddrMod; /* local addr modifier reg */
volatile unsigned char rsv3;
volatile unsigned char rsv4;
volatile unsigned char LocalIntrVec; /* local intr vector reg */
volatile unsigned char RemoteCmd2; /* remote command register 2 */
volatile unsigned char RemoteCmd1; /* remote command register 1 */
volatile unsigned char RemotePageAddrHigh; /* hi 8 bits remote pg addr */
volatile unsigned char RemotePageAddrLow; /* low 8 bits remote pg addr */
volatile unsigned char RemoteAddrMod; /* remote address modifier */
volatile unsigned char rsv5;
volatile unsigned char RemoteIackReadHigh; /* intr acknowledge read hi */
volatile unsigned char RemoteIackReadLow; /* intr acknowledge read low */
} DevVMElinkCtrlRegs;
typedef struct DevVMElinkDmaRegs {
volatile unsigned char localDmaCmdReg;
volatile unsigned char rsv0;
volatile unsigned char localDmaAddr3;
volatile unsigned char localDmaAddr2;
volatile unsigned char localDmaAddr1;
volatile unsigned char localDmaAddr0;
volatile unsigned char dmaLength2;
volatile unsigned char dmaLength1;
volatile unsigned char rsv1;
volatile unsigned char rsv2;
volatile unsigned char remoteDmaAddr3;
volatile unsigned char remoteDmaAddr2;
volatile unsigned char remoteDmaAddr1;
volatile unsigned char remoteDmaAddr0;
volatile unsigned char rsv3;
volatile unsigned char rsv4;
} DevVMElinkDmaRegs;
/*
* Used in the IOControl status call.
*/
typedef struct DevVMElinkStatus {
int LocalStatus;
int RemoteStatus;
} DevVMElinkStatus;
/*
* Structure used to map VME bus addresses into kernel memory.
*/
typedef struct DevVMElinkMapRequest {
void *VMEAddress; /* VME address to map */
int mapSize; /* number of bytes to map in */
void *kernelAddress; /* resulting kernel address */
} DevVMElinkMapRequest;
#define DEV_VMELINK_TO_REMOTE 0xf5
#define DEV_VMELINK_TO_LOCAL 0x3d
/*
* Used to access memory over the link board.
*/
typedef struct DevVMElinkAccessMem {
Address destAddress;
int size;
int direction;
int data[1];
} DevVMElinkAccessMem;
#define IOC_VMELINK (16 << 16)
/*
* These are the special VME link IO control calls. They
* perform the following functions (and all constants start with
* IOC_VMELINK_).
*
* STATUS return the link's status in the VMElinkStatus structure.
* PING_REMOTE return SUCCESS if the remote link card is up
* MAP_MEMORY map an area of memory specified by a VMElinkMapRequest struct
* NO_ADDRMOD turn off the address modifier register
* SET_ADDRMOD set the address modifier to use instead of the VME bus default
* NO_WINDOW turn off the paging register on the link card
* SET_WINDOW set the paging register on the link card and turn on paging
* SET_WINDOW_SIZE set the size of the paging register window
* LOW_VME seeks refer to addresses 0-7fffffff
* HIGH_VME seeks refer to addresses 8000000-ffffffff
* DEBUG_ON turns on debugging statements for the VME link driver
* DEBUG_OFF turns off debugging statements
*/
#define IOC_VMELINK_STATUS (IOC_VMELINK | 1)
#define IOC_VMELINK_DEBUG_ON (IOC_VMELINK | 2)
#define IOC_VMELINK_DEBUG_OFF (IOC_VMELINK | 3)
#define IOC_VMELINK_PING_REMOTE (IOC_VMELINK | 4)
#define IOC_VMELINK_NO_ADDRMOD (IOC_VMELINK | 5)
#define IOC_VMELINK_SET_ADDRMOD (IOC_VMELINK | 6)
#define IOC_VMELINK_LOW_VME (IOC_VMELINK | 7)
#define IOC_VMELINK_HIGH_VME (IOC_VMELINK | 8)
#define IOC_VMELINK_READ_BOARD_STATUS (IOC_VMELINK | 9)
#define IOC_VMELINK_RESET (IOC_VMELINK | 10)
#define IOC_VMELINK_READ_REG (IOC_VMELINK | 11)
#define IOC_VMELINK_WRITE_REG (IOC_VMELINK | 12)
#define IOC_VMELINK_ACCESS_REMOTE_MEMORY (IOC_VMELINK | 13)
#define IOC_VMELINK_SAFE_COPY_ON (IOC_VMELINK | 14)
#define IOC_VMELINK_SAFE_COPY_OFF (IOC_VMELINK | 15)
#endif /* _VMELINK */
@
1.3
log
@This version works with the kernel that supports slow copying (no DMA).
@
text
@d15 1
a15 1
* $Header: /sprite/src/kernel/dev/sun4.md/RCS/vmelink.h,v 1.1 91/09/18 12:39:35 jhh Exp Locker: elm $ SPRITE (Berkeley)
d193 2
@
1.2
log
@Changed vme link device # to 16 (from 13).
@
text
@d15 1
a15 1
* $Header: /sprite/src/lib/include/dev/RCS/vmelink.h,v 1.1 90/12/05 12:25:40 elm Exp Locker: elm $ SPRITE (Berkeley)
d22 5
d29 3
a31 3
#define VMELINK_VME_START_ADDR 0xff400000
#define VMELINK_VME_ADDR_SIZE 0x00020000
#define VMELINK_NUM_PAGES (VMELINK_VME_ADDR_SIZE / PAGSIZ)
d36 4
a39 4
#define VMELINK_CLEAR_LOCAL_ERRS 0x80
#define VMELINK_CLEAR_LOCAL_PF_INT 0x40
#define VMELINK_SET_REMOTE_PT_INT 0x20
#define VMELINK_DISABLE_LOCAL_INT 0x04
d44 5
a48 5
#define VMELINK_PARITY_ERROR 0x80
#define VMELINK_REMOTE_BUSERR 0x40
#define VMELINK_LOCAL_PR_INT 0x20
#define VMELINK_LOCAL_PT_INT 0x02
#define VMELINK_REMOTE_DOWN 0x01
d53 5
a57 5
#define VMELINK_REMOTE_RESET 0x80
#define VMELINK_CLEAR_REMOTE_PT_INT 0x40
#define VMELINK_SET_REMOTE_PR_INT 0x20
#define VMELINK_LOCK_VME 0x10
#define VMELINK_USE_PAGE_REG 0x08
d62 3
a64 3
#define VMELINK_REMOTE_USE_ADDRMOD 0x40
#define VMELINK_REMOTE_BLKMODE_DMA 0x20
#define VMELINK_DISABLE_REMOTE_INT 0x10
d69 60
a128 5
#define VMELINK_WINDOW_SIZE_64K 0x00
#define VMELINK_WINDOW_SIZE_128K 0x01
#define VMELINK_WINDOW_SIZE_256K 0x03
#define VMELINK_WINDOW_SIZE_512K 0x07
#define VMELINK_WINDOW_SIZE_1M 0x0f
d133 1
a133 1
typedef struct VMElinkStatus {
d136 1
a136 1
} VMElinkStatus;
d141 1
a141 1
typedef struct VMElinkMapRequest {
d145 1
a145 1
} VMElinkMapRequest;
d147 13
d162 31
a192 8
#define IOC_VMELINK_STATUS (IOC_VMELINK | 0x1)
#define IOC_VMELINK_PING_REMOTE (IOC_VMELINK | 0x3)
#define IOC_VMELINK_MAP_MEMORY (IOC_VMELINK | 0x4)
#define IOC_VMELINK_NO_ADDRMOD (IOC_VMELINK | 0x5)
#define IOC_VMELINK_SET_ADDRMOD (IOC_VMELINK | 0x6)
#define IOC_VMELINK_NO_WINDOW (IOC_VMELINK | 0x7)
#define IOC_VMELINK_SET_WINDOW (IOC_VMELINK | 0x8)
#define IOC_VMELINK_SET_WINDOW_SIZE (IOC_VMELINK | 0x9)
@
1.1
log
@Initial revision
@
text
@d15 1
a15 1
* $Header: /sprite/src/kernel/dev.elm/sun4.md/RCS/vmelink.h,v 1.1 90/06/28 23:44:46 elm Exp Locker: elm $ SPRITE (Berkeley)
d87 1
a87 1
#define IOC_VMELINK (13 << 16)
@